**********************************
*** Goldring, Schmid, & Apaydin
*** Blame Shifting in Autocracies
*** Perspectives on Politics
*** Replication code
**********************************



******************
*** Open log file
******************
log using GSA_PoP_Log, replace



*****************
*** Load dataset
*****************
local drive ""
cd "`drive'"
use "GSA_PoP_TablesFigures.dta", clear



**********************************************************
*** Figure 2: Approval of Recep Tayyip Erdogan, 2003-2021
**********************************************************
preserve
	use "EAD 3.0 Annual_11282023.dta", clear
	twoway line Approval_Not_Smoothed year if country_name=="Turkey_Pres", lcolor(black) ///
		|| line Approval_Not_Smoothed year if country_name=="Turkey_PM" & year<2014 & year>=2003, lcolor(black) ///
		ytitle(Erdoğan Approval) ///
		ylab(30(10)80) ///
		xtitle(Year) ///
		xlab(2000(5)2025) ///
		xline(2003, lpattern(shortdash) lcolor(gs10)) ///
		xline(2007, lpattern(shortdash) lcolor(gs10)) ///
		xline(2011, lpattern(shortdash) lcolor(gs10)) ///
		xline(2014, lpattern(longdash) lcolor(gs10)) ///
		xline(2018, lpattern(longdash) lcolor(gs10)) ///
		xline(2023, lpattern(longdash) lcolor(gs10)) ///
		legend(pos(6) rows(1) order(2 "Prime Minister" 1 "President")) ///
		note("{it:Note}: Erdoğan became prime minister in 2003 following a by-election, and led the AKP to victories in the Grand National Assembly in 2007 and" "2011, as indicated by the short-dashed lines; he was then elected to the presidency in 2014, winning reelection in 2018 and 2023, as indicated""by the long dashed lines.", pos(7) size(vsmall)) ///
		scheme(plotplain)
restore



**************************************************************************
*** Table 1: Summary of Average Treatment Effects on Approval for Erdogan
**************************************************************************
est clear
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8, robust
estadd local sample "Full", replace
estadd local i `e(N)'
estadd local controls "Yes"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if order==2, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
estadd local controls "Yes"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if order==1, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
estadd local controls "Yes"
esttab using "`drive'/ATEreduced.tex", replace ///
	keep(t2 t3 t4 t5 _cons) ///
	b(2) se(2) nomtitles label ///
	booktabs ///
	star(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
	longtable ///
	s(r2 controls sample i, label("R2" "Controls" "Sample" "Observations")) ///
	title("Summary of Average Treatment Effects on Approval for Erdoğan \label{tab:ATEreduced}"\centering)



**********************************************************
*** Figure 3: Predictive Margins for the Primed Treatment
**********************************************************	
reg o1_std i.treatment female age education govt_emp income islam r2-r8 if order==1, robust
margins i.treatment, level(84)
marginsplot, ///
	recast(scatter) ///
	scheme(plotplain) ///
	yscale(range (0 .6)) ylabel(0(.2).6) ytitle("Erdoğan approval") ///
	byopts(title("")) ///
	xtitle("Control or Treatment Groups") xlabel(1 "Control" 2 `""Force" "majeure""' 3 "Minister" 4 "Opposition" 5 `""Private" "companies""') ///
	title("") ///
	name(ATEprimed, replace) ///
	graphregion(margin(5 10 5 10))



****************************************************************
*** Figure 4: Primed Treatment Effects Conditional on Education
****************************************************************
preserve
keep if order==1
reg o1_std i.t2##c.education female age education govt_emp income islam r2-r8 if treatment==1 | treatment==2, robust
margins t2, at(education=(0(1)5)) level(84)
marginsplot, ///
	scheme(plotplain) ///
	yscale(range (.2 .6)) ylabel(.2(.1).8) ytitle("Erdoğan approval") ///
	byopts(title("")) ///
	ci1opt(color(gray)) ci2opt(color(black)) ///
	plot1opts(msymbol(oh) mcolor(gray) lcolor(gray)) plot2opts(msymbol(X) mcolor(black) lcolor(black)) ///	
	title("Treatment: Force majeure") ///
	xtitle("") xlabel(0 `""Primary""school""' 1 `""Middle""school""' 2 `""High""school""' 3 `""College""diploma""' 4 `""Bachlor's""degree""' 5 `""Master's""or higher""', labsize(vsmall)) ///
	legend(order(3 "Control" 4 "Treatment") pos(6) rows(1)) ///
	name(HETeducationt2, replace)
reg o1_std i.t3##c.education female age education govt_emp income islam r2-r8 if treatment==1 | treatment==3, robust
margins t3, at(education=(0(1)5)) level(84)
marginsplot, ///
	scheme(plotplain) ///
	yscale(range (.2 .6)) ylabel(.2(.1).8) ytitle("Erdoğan approval") ///
	byopts(title("")) ///
	ci1opt(color(gray)) ci2opt(color(black)) ///
	plot1opts(msymbol(oh) mcolor(gray) lcolor(gray)) plot2opts(msymbol(X) mcolor(black) lcolor(black)) ///	
	title("Treatment: Minister") ///
	xtitle("") xlabel(0 `""Primary""school""' 1 `""Middle""school""' 2 `""High""school""' 3 `""College""diploma""' 4 `""Bachlor's""degree""' 5 `""Master's""or higher""', labsize(vsmall)) ///
	legend(order(3 "Control" 4 "Treatment") pos(6) rows(1)) ///
	name(HETeducationt3, replace)
reg o1_std i.t4##c.education female age education govt_emp income islam r2-r8 if treatment==1 | treatment==4, robust
margins t4, at(education=(0(1)5)) level(84)
marginsplot, ///
	scheme(plotplain) ///
	yscale(range (.2 .6)) ylabel(.2(.1).8) ytitle("Erdoğan approval") ///
	byopts(title("")) ///
	ci1opt(color(gray)) ci2opt(color(black)) ///
	plot1opts(msymbol(oh) mcolor(gray) lcolor(gray)) plot2opts(msymbol(X) mcolor(black) lcolor(black)) ///	
	title("Treatment: Opposition") ///
	xtitle("") xlabel(0 `""Primary""school""' 1 `""Middle""school""' 2 `""High""school""' 3 `""College""diploma""' 4 `""Bachlor's""degree""' 5 `""Master's""or higher""', labsize(vsmall)) ///
	legend(order(3 "Control" 4 "Treatment") pos(6) rows(1)) ///
	name(HETeducationt4, replace)
reg o1_std i.t5##c.education female age education govt_emp income islam r2-r8 if treatment==1 | treatment==5, robust
margins t5, at(education=(0(1)5)) level(84)
marginsplot, ///
	scheme(plotplain) ///
	yscale(range (.2 .6)) ylabel(.2(.1).8) ytitle("Erdoğan approval") ///
	byopts(title("")) ///
	ci1opt(color(gray)) ci2opt(color(black)) ///
	plot1opts(msymbol(oh) mcolor(gray) lcolor(gray)) plot2opts(msymbol(X) mcolor(black) lcolor(black)) ///	
	title("Treatment: Private companies") ///
	xtitle("") xlabel(0 `""Primary""school""' 1 `""Middle""school""' 2 `""High""school""' 3 `""College""diploma""' 4 `""Bachlor's""degree""' 5 `""Master's""or higher""', labsize(vsmall)) ///
	legend(order(3 "Control" 4 "Treatment") pos(6) rows(1)) ///
	name(HETeducationt5, replace)
grc1leg HETeducationt2 HETeducationt3 HETeducationt4 HETeducationt5, ///
		graphregion(color(white)) ///
		rows(2) ///
		name(HETeducation, replace)
restore



*************************************************************
*** Figure 5: Primed Treatment Effects Conditional on Income
*************************************************************
preserve
keep if order==1
reg o1_std i.t2##c.income female age education govt_emp income islam r2-r8 if treatment==1 | treatment==2, robust
margins t2, at(income=(0(1)10)) level(84)
marginsplot, ///
	scheme(plotplain) ///
	yscale(range (.2 .6)) ylabel(.2(.1).6) ytitle("Erdoğan approval") ///
	byopts(title("")) ///
	ci1opt(color(gray)) ci2opt(color(black)) ///
	plot1opts(msymbol(oh) mcolor(gray) lcolor(gray)) plot2opts(msymbol(X) mcolor(black) lcolor(black)) ///	
	title("Treatment: Force majeure") ///
	xtitle("") xlabel(0 `""Less than""2,500 TL""' 1 `""2,500-""4,999 TL""' 2 `""5,000-""7,499 TL""' 3 `""7,500-""9,999 TL""' 4 `""10,000-""12,499 TL""' 5 `""12,500-""14,999 TL""' 6 `""15,000-""17,499 TL""' 7 `""17,500-""19,999 TL""' 8 `""20,000-""22,499 TL""' 9 `""22,500-""24,999 TL""' 10 `""25,000 TL""or more""', labsize(tiny)) ///
	legend(order(3 "Control" 4 "Treatment") pos(6) rows(1)) ///
	name(HETincomet2, replace)
reg o1_std i.t3##c.income female age education govt_emp income islam r2-r8 if treatment==1 | treatment==3, robust
margins t3, at(income=(0(1)10)) level(84)
marginsplot, ///
	scheme(plotplain) ///
	yscale(range (.2 .6)) ylabel(.2(.1).6) ytitle("Erdoğan approval") ///
	byopts(title("")) ///
	ci1opt(color(gray)) ci2opt(color(black)) ///
	plot1opts(msymbol(oh) mcolor(gray) lcolor(gray)) plot2opts(msymbol(X) mcolor(black) lcolor(black)) ///	
	title("Treatment: Minister") ///
	xtitle("") xlabel(0 `""Less than""2,500 TL""' 1 `""2,500-""4,999 TL""' 2 `""5,000-""7,499 TL""' 3 `""7,500-""9,999 TL""' 4 `""10,000-""12,499 TL""' 5 `""12,500-""14,999 TL""' 6 `""15,000-""17,499 TL""' 7 `""17,500-""19,999 TL""' 8 `""20,000-""22,499 TL""' 9 `""22,500-""24,999 TL""' 10 `""25,000 TL""or more""', labsize(tiny)) ///
	legend(order(3 "Control" 4 "Treatment") pos(6) rows(1)) ///
	name(HETincomet3, replace)
reg o1_std i.t4##c.income female age education govt_emp income islam r2-r8 if treatment==1 | treatment==4, robust
margins t4, at(income=(0(1)10)) level(84)
marginsplot, ///
	scheme(plotplain) ///
	yscale(range (.2 .6)) ylabel(.2(.1).6) ytitle("Erdoğan approval") ///
	byopts(title("")) ///
	ci1opt(color(gray)) ci2opt(color(black)) ///
	plot1opts(msymbol(oh) mcolor(gray) lcolor(gray)) plot2opts(msymbol(X) mcolor(black) lcolor(black)) ///	
	title("Treatment: Opposition") ///
	xtitle("") xlabel(0 `""Less than""2,500 TL""' 1 `""2,500-""4,999 TL""' 2 `""5,000-""7,499 TL""' 3 `""7,500-""9,999 TL""' 4 `""10,000-""12,499 TL""' 5 `""12,500-""14,999 TL""' 6 `""15,000-""17,499 TL""' 7 `""17,500-""19,999 TL""' 8 `""20,000-""22,499 TL""' 9 `""22,500-""24,999 TL""' 10 `""25,000 TL""or more""', labsize(tiny)) ///
	legend(order(3 "Control" 4 "Treatment") pos(6) rows(1)) ///
	name(HETincomet4, replace)
reg o1_std i.t5##c.income female age education govt_emp income islam r2-r8 if treatment==1 | treatment==5, robust
margins t5, at(income=(0(1)10)) level(84)
marginsplot, ///
	scheme(plotplain) ///
	yscale(range (.2 .6)) ylabel(.2(.1).6) ytitle("Erdoğan approval") ///
	byopts(title("")) ///
	ci1opt(color(gray)) ci2opt(color(black)) ///
	plot1opts(msymbol(oh) mcolor(gray) lcolor(gray)) plot2opts(msymbol(X) mcolor(black) lcolor(black)) ///	
	title("Treatment: Private companies") ///
	xtitle("") xlabel(0 `""Less than""2,500 TL""' 1 `""2,500-""4,999 TL""' 2 `""5,000-""7,499 TL""' 3 `""7,500-""9,999 TL""' 4 `""10,000-""12,499 TL""' 5 `""12,500-""14,999 TL""' 6 `""15,000-""17,499 TL""' 7 `""17,500-""19,999 TL""' 8 `""20,000-""22,499 TL""' 9 `""22,500-""24,999 TL""' 10 `""25,000 TL""or more""', labsize(tiny)) ///
	legend(order(3 "Control" 4 "Treatment") pos(6) rows(1)) ///
	name(HETincomet5, replace)

grc1leg HETincomet2 HETincomet3 HETincomet4 HETincomet5, ///
		graphregion(color(white)) ///
		rows(2) ///
		name(HTEincome, replace)
restore



**********************************************************************
*** Table 2: Summary of Treatment Effects Conditional on Partisanship
**********************************************************************
est clear
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==1, robust
estadd local sample "Full", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Erdoğan"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==2, robust
estadd local sample "Full", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Opposition"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==3, robust
estadd local sample "Full", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Unaffiliated"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==1 & order==2, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Erdoğan"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==2 & order==2, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Opposition"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==3 & order==2, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Unaffiliated"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==1 & order==1, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Erdoğan"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==2 & order==1, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Opposition"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==3 & order==1, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Unaffiliated"
esttab using "`drive'/HTEmiddlereduced.tex", replace ///
	keep(t2 t3 t4 t5 _cons) ///
	b(2) se(2) nomtitles label ///
	booktabs ///
	star(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
	longtable ///
	s(controls sample middle i, label("Controls" "Sample" "Partisanship" "Observations")) ///
	title("Summary of Treatment Effects Conditional on Partisanship \label{tab:HTEmiddlereduced}"\centering)



*********************************
*** Table F1: Summary Statistics
*********************************
estpost tabstat o1_std o2_std akp o6_std dv o8_std o4_std rpp o7_std female age education govt_emp income islam r2 r3 r4 r5 r6 r7 r8, c(stat) stat(min max mean sd)
ereturn list
esttab . using "`drive'/summary.tex", replace ///
	cells("min max mean(fmt(%6.2fc)) sd(fmt(%6.2fc))") nonumber ///
	nomtitle nonote noobs label collabels("Minimum" "Maximum" "Mean" "Standard deviation") ///
	title("Summary Statistics \label{tab:summary}")



*********************************************************************
*** Table H1: Covariate Balance Between Control and Treatment Groups
*********************************************************************
global covar "female age education govt_emp income islam r1 r2 r3 r4 r5 r6 r7 r8"

sum $covar
tabstat $covar, by(treatment) nototal

mat Ftest=J(14,1,0)
local j=1
qui foreach var of varlist $covar {
  reg `var' i.treat, r
  test 1.tr=2.tr=0
  mat Ftest[`j',1]=r(p)
  local j = `j'+1
}
mat list Ftest



****************************************************************
*** Table I1: Average Treatment Effects on Approval for Erdogan
****************************************************************
est clear
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8, robust
estadd local sample "Full", replace
estadd local i `e(N)'
estadd local controls "Yes"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if order==2, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
estadd local controls "Yes"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if order==1, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
estadd local controls "Yes"
esttab using "`drive'/ATEfull.tex", replace ///
	b(2) se(2) nomtitles label ///
	booktabs ///
	star(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
	longtable ///
	s(sample i, label("Sample" "Observations")) ///
	title("Average Treatment Effects on Approval for Erdoğan \label{tab:ATEfull}"\centering)



*************************************************************************************
*** Table I2: Average Treatment Effects on Approval for Erdogan (without covariates)
*************************************************************************************
est clear
eststo: reg o1_std t2-t5, robust
estadd local sample "Full", replace
estadd local i `e(N)'
estadd local controls "No"
eststo: reg o1_std t2-t5 if order==2, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
estadd local controls "No"
eststo: reg o1_std t2-t5 if order==1, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
estadd local controls "No"
esttab using "`drive'/ATEnocovariates.tex", replace ///
	b(2) se(2) nomtitles label ///
	booktabs ///
	star(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
	longtable ///
	s(sample i, label("Sample" "Observations")) ///
	title("Average Treatment Effects on Approval for Erdoğan \label{tab:ATEnocovariates}"\centering)



***************************************************************************************************
*** Table I3: Average Treatment Effects on Approval for Erdogan with Post-Strategification Weights
***************************************************************************************************
preserve
	est clear
	import delimited using "GSA_PoP_Weights.csv", clear
	label var o1_std "Erdoğan approval"
	label var t2 "Force majeure"
	label var t3 "Minister"
	label var t4 "Opposition"
	label var t5 "Private companies"
	label var female "Female"
	label var age "Age"
	label var education "Education"
	label var govt_emp "Public sector employee"
	label var income "Income"
	label var islam "Islam"
	label var r2 "Aegean"
	label var r3 "Black Sea"
	label var r4 "Central Anatolia"
	label var r5 "Eastern Anatolia"
	label var r6 "Marmara"
	label var r7 "Mediterranean"
	label var r8 "Southeastern Anatolia"
	replace weight_province="." if weight_province=="NA"
	destring weight_province, replace
	gen weight_comp=weight_gender*weight_age*weight_edu*weight_province*weight_religion
	eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 [pweight=1/weight_comp], robust
	estadd local i`e(N)'
	estadd local sample "Full", replace
	eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 [pweight=1/weight_comp] if order==2, robust
	estadd local i`e(N)'
	estadd local sample "Unprimed", replace
	eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 [pweight=1/weight_comp] if order==1, robust
	estadd local i`e(N)'
	estadd local sample "Primed", replace
	esttab using "`drive'/ATEweights.tex", replace ///
		b(2) se(2) nomtitles label ///
		booktabs ///
		star(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
		longtable ///
		s(sample i, label("Sample" "Observations")) ///
		title("Average Treatment Effects on Approval for Erdoğan with Post-Stratification Weights \label{tab:weights}"\centering)
restore



************************************************************
*** Table I4: Average Treatment Effects on Various Outcomes
************************************************************
est clear
eststo: reg o2_std t2-t5 female age education govt_emp income islam r2-r8, robust	
estadd local i `e(N)'
estadd local outcome "Erdoğan vote intention", replace
eststo: reg akp t2-t5 female age education govt_emp income islam r2-r8, robust	
estadd local i `e(N)'
estadd local outcome "AKP vote intention", replace
eststo: reg o6_std t2-t5 female age education govt_emp income islam r2-r8, robust	
estadd local i `e(N)'
estadd local outcome "Erdoğan volunteer intention", replace
eststo: reg o8_std t2-t5 female age education govt_emp income islam r2-r8, robust
estadd local i `e(N)'
estadd local outcome "Government earthquake response", replace
eststo: kict ls dv t2-t5 female age education govt_emp income islam r2-r8, nn(3) est(linear) cond(dummy) vce(robust)
estadd local i `e(N)'
estadd local outcome "Kılıçdaroğlu vote intention", replace
eststo: reg rpp t2-t5 female age education govt_emp income islam r2-r8, robust	
estadd local i `e(N)'
estadd local outcome "CHP vote intention", replace
eststo: reg o7_std t2-t5 female age education govt_emp income islam r2-r8, robust	
estadd local i `e(N)'
estadd local outcome "Kılıçdaroğlu volunteer intention", replace
esttab using "`drive'/ATEothers.tex", replace ///
	b(2) se(2) nomtitles label ///
	booktabs ///
	star(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
	longtable ///
	s(outcome i, label("Outcome" "Observations")) ///
	title("Average Treatment Effects on Various Outcomes \label{tab:ATEothers}"\centering)



*********************************************************
*** Table I5: Treatment Effects Conditional on Education
*********************************************************
est clear
eststo: reg o1_std i.t2##c.education female age govt_emp income islam r2-r8 if treatment==1 | treatment==2, robust
estadd local sample "Full", replace
estadd local i `e(N)'
eststo: reg o1_std i.t2##c.education female age govt_emp income islam r2-r8 if treatment==1 & order==1 | treatment==2 & order==1, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t2##c.education female age govt_emp income islam r2-r8 if treatment==1 & order==2 | treatment==2 & order==2, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t3##c.education female age govt_emp income islam r2-r8 if treatment==1 | treatment==3, robust
estadd local sample "Full", replace
estadd local i `e(N)'
eststo: reg o1_std i.t3##c.education female age govt_emp income islam r2-r8 if treatment==1 & order==1 | treatment==3 & order==1, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t3##c.education female age govt_emp income islam r2-r8 if treatment==1 & order==2 | treatment==3 & order==2, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t4##c.education female age govt_emp income islam r2-r8 if treatment==1 | treatment==4, robust
estadd local sample "Full", replace
estadd local i `e(N)'
eststo: reg o1_std i.t4##c.education female age govt_emp income islam r2-r8 if treatment==1 & order==1 | treatment==4 & order==1, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t4##c.education female age govt_emp income islam r2-r8 if treatment==1 & order==2 | treatment==4 & order==2, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t5##c.education female age govt_emp income islam r2-r8 if treatment==1 | treatment==5, robust
estadd local sample "Full", replace
estadd local i `e(N)'
eststo: reg o1_std i.t5##c.education female age govt_emp income islam r2-r8 if treatment==1 & order==1 | treatment==5 & order==1, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t5##c.education female age govt_emp income islam r2-r8 if treatment==1 & order==2 | treatment==5 & order==2, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
esttab using "`drive'/HTEeducation.tex", replace ///
	keep(education 1.t2 1.t2#c.education 1.t3 1.t3#c.education 1.t4 1.t4#c.education 1.t5 1.t5#c.education female age govt_emp income islam r2 r3 r4 r5 r6 r7 r8 _cons) ///
	order(education 1.t2 1.t2#c.education 1.t3 1.t3#c.education 1.t4 1.t4#c.education 1.t5 1.t5#c.education female age govt_emp income islam r2 r3 r4 r5 r6 r7 r8 _cons) ///
	b(2) se(2) nomtitles label ///
	booktabs ///
	star(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
	longtable ///
	s(sample i, label("Sample" "Observations")) ///
	title("Treatment Effects Conditional on Education \label{tab:HTEeducation}"\centering)


******************************************************
*** Table I6: Treatment Effects Conditional on Income
******************************************************
est clear
eststo: reg o1_std i.t2##c.income female age education govt_emp islam r2-r8 if treatment==1 | treatment==2, robust
estadd local sample "Full", replace
estadd local i `e(N)'
eststo: reg o1_std i.t2##c.income female age education govt_emp islam r2-r8 if treatment==1 & order==1 | treatment==2 & order==1, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t2##c.income female age education govt_emp islam r2-r8 if treatment==1 & order==2 | treatment==2 & order==2, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t3##c.income female age education govt_emp islam r2-r8 if treatment==1 | treatment==3, robust
estadd local sample "Full", replace
estadd local i `e(N)'
eststo: reg o1_std i.t3##c.income female age education govt_emp islam r2-r8 if treatment==1 & order==1 | treatment==3 & order==1, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t3##c.income female age education govt_emp islam r2-r8 if treatment==1 & order==2 | treatment==3 & order==2, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t4##c.income female age education govt_emp islam r2-r8 if treatment==1 | treatment==4, robust
estadd local sample "Full", replace
estadd local i `e(N)'
eststo: reg o1_std i.t4##c.income female age education govt_emp islam r2-r8 if treatment==1 & order==1 | treatment==4 & order==1, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t4##c.income female age education govt_emp islam r2-r8 if treatment==1 & order==2 | treatment==4 & order==2, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t5##c.income female age education govt_emp islam r2-r8 if treatment==1 | treatment==5, robust
estadd local sample "Full", replace
estadd local i `e(N)'
eststo: reg o1_std i.t5##c.income female age education govt_emp islam r2-r8 if treatment==1 & order==1 | treatment==5 & order==1, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
eststo: reg o1_std i.t5##c.income female age education govt_emp islam r2-r8 if treatment==1 & order==2 | treatment==5 & order==2, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
esttab using "`drive'/HTEincome.tex", replace ///
	keep(income 1.t2 1.t2#c.income 1.t3 1.t3#c.income 1.t4 1.t4#c.income 1.t5 1.t5#c.income female age govt_emp education islam r2 r3 r4 r5 r6 r7 r8 _cons) ///
	order(income 1.t2 1.t2#c.income 1.t3 1.t3#c.income 1.t4 1.t4#c.income 1.t5 1.t5#c.income female age govt_emp education islam r2 r3 r4 r5 r6 r7 r8 _cons) ///
	b(2) se(2) nomtitles label ///
	booktabs ///
	star(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
	longtable ///
	s(sample i, label("Sample" "Observations")) ///
	title("Treatment Effects Conditional on Income \label{tab:HTEincome}"\centering)




************************************************************
*** Table I7: Treatment Effects Conditional on Partisanship
************************************************************
est clear
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==1, robust
estadd local sample "Full", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Erdoğan"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==2, robust
estadd local sample "Full", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Opposition"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==3, robust
estadd local sample "Full", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Unaffiliated"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==1 & order==2, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Erdoğan"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==2 & order==2, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Opposition"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==3 & order==2, robust
estadd local sample "Unprimed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Unaffiliated"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==1 & order==1, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Erdoğan"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==2 & order==1, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Opposition"
eststo: reg o1_std t2-t5 female age education govt_emp income islam r2-r8 if partisan==3 & order==1, robust
estadd local sample "Primed", replace
estadd local i `e(N)'
estadd local controls "Yes"
estadd local middle "Unaffiliated"
esttab using "`drive'/HTEmiddlefull.tex", replace ///
	b(2) se(2) nomtitles label ///
	booktabs ///
	star(+ 0.10 * 0.05 ** 0.01 *** 0.001)	///
	longtable ///
	s(sample middle i, label("Sample" "Partisanship" "Observations")) ///
	title("Treatment Effects Conditional on Partisanship \label{tab:HTEmiddlefull}"\centering)



*******************
*** Close log file
*******************
log close


